home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / flight-of-the-museum.swf / scripts / engine / levelData / Level_16.as < prev    next >
Encoding:
Text File  |  2011-10-17  |  4.2 KB  |  128 lines

  1. package engine.levelData
  2. {
  3.    import copy.CopyBank;
  4.    import engine.WorldScene;
  5.    import engine.dynamicObjects.*;
  6.    
  7.    public class Level_16 extends LevelData
  8.    {
  9.        
  10.       
  11.       public function Level_16()
  12.       {
  13.          super();
  14.          _goalParameters = new Array();
  15.       }
  16.       
  17.       override public function buildLevel() : *
  18.       {
  19.          var i:* = undefined;
  20.          var rNum:* = undefined;
  21.          var podium:* = undefined;
  22.          var cage:* = undefined;
  23.          var px:Number = NaN;
  24.          var giantTentacle:* = undefined;
  25.          var fuelIcon:* = undefined;
  26.          var goalObj:Object = null;
  27.          var missionObj:Object = null;
  28.          var indian:* = undefined;
  29.          var rX:Number = NaN;
  30.          super.buildLevel();
  31.          rNum = Math.random();
  32.          for(i = 0; i < 24; i++)
  33.          {
  34.             rNum = Math.random();
  35.             px = 150 + Math.random() * 75 + i * 175;
  36.             if(rNum < 0.3)
  37.             {
  38.                podium = new Podium("tall");
  39.                podium.x = px;
  40.                podium.y = 700;
  41.                WorldScene.Instance.GameplayObjects.push(podium);
  42.                cage = new Cage1();
  43.                cage.x = podium.x;
  44.                cage.y = 568;
  45.                WorldScene.Instance.GameplayObjects.push(cage);
  46.                WorldScene.Instance.Cages.push(cage);
  47.             }
  48.             if(rNum >= 0.3 && rNum < 0.6)
  49.             {
  50.                podium = new Podium("med");
  51.                podium.x = px;
  52.                podium.y = 700;
  53.                WorldScene.Instance.GameplayObjects.push(podium);
  54.                cage = new Cage1();
  55.                cage.x = podium.x;
  56.                cage.y = 582;
  57.                WorldScene.Instance.GameplayObjects.push(cage);
  58.                WorldScene.Instance.Cages.push(cage);
  59.             }
  60.             if(rNum >= 0.6)
  61.             {
  62.                podium = new Podium("short");
  63.                podium.x = px;
  64.                podium.y = 700;
  65.                WorldScene.Instance.GameplayObjects.push(podium);
  66.                cage = new Cage1();
  67.                cage.x = podium.x;
  68.                cage.y = 604;
  69.                WorldScene.Instance.GameplayObjects.push(cage);
  70.                WorldScene.Instance.Cages.push(cage);
  71.             }
  72.          }
  73.          for(i = 0; i < 24; i++)
  74.          {
  75.             px = 150 + Math.random() * 100 + i * 175;
  76.             indian = new Indian();
  77.             indian.x = px - 12;
  78.             indian.y = 710;
  79.             indian.LobMode = true;
  80.             WorldScene.Instance.GameplayObjects.push(indian);
  81.             WorldScene.Instance.Indians.push(indian);
  82.             indian = new Indian();
  83.             indian.x = px + 12;
  84.             indian.y = 710;
  85.             indian.LobMode = true;
  86.             WorldScene.Instance.GameplayObjects.push(indian);
  87.             WorldScene.Instance.Indians.push(indian);
  88.          }
  89.          for(i = 0; i < 7; i++)
  90.          {
  91.             rX = 3000 + i * 550;
  92.             giantTentacle = new GiantTentacle();
  93.             giantTentacle.r = 0.2;
  94.             giantTentacle.baseX = rX;
  95.             giantTentacle.baseY = -250;
  96.             giantTentacle.hiddenX = rX;
  97.             giantTentacle.hiddenY = -1000;
  98.             giantTentacle.init();
  99.             WorldScene.Instance.TentacleObjects.push(giantTentacle);
  100.          }
  101.          fuelIcon = new FuelIcon();
  102.          fuelIcon.x = 4000;
  103.          fuelIcon.y = 2000;
  104.          WorldScene.Instance.GameplayObjects.push(fuelIcon);
  105.          fuelIcon = new FuelIcon();
  106.          fuelIcon.x = 5000;
  107.          fuelIcon.y = 2000;
  108.          WorldScene.Instance.GameplayObjects.push(fuelIcon);
  109.          _missionDescription = CopyBank.Instance.MissionDesc_Cages;
  110.          goalObj = {
  111.             "Type":"Cage",
  112.             "Count":24
  113.          };
  114.          _goalParameters.push(goalObj);
  115.          missionObj = {
  116.             "Description":_missionDescription,
  117.             "GoalParamaters":_goalParameters,
  118.             "PrimaryGoalType":"Cages",
  119.             "StartLoc":{
  120.                "x":6000,
  121.                "y":400
  122.             }
  123.          };
  124.          WorldScene.Instance.setMissionDetails(missionObj);
  125.       }
  126.    }
  127. }
  128.